package com.txm.drawPic;
/*
 * 爆炸效果
 *
 * */

import java.awt.*;

public class Bomb {
    private int x;
    private int y;

    private boolean isLive = true;
    int life = 18;
    private int index = 0;

    public Bomb(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public void lifeDown() {
        if (life > 0) {
            life -= 3;
        } else {
            isLive = false;
        }
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }


    public boolean isLive() {
        return isLive;
    }

    public void setLive(boolean live) {
        isLive = live;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    @Override
    public String toString() {
        return "Bomb{" +
                "x=" + x +
                ", y=" + y +
                ", isLive=" + isLive +
                ", life=" + life +
                ", index=" + index +
                '}';
    }
}
